package zuo.from0516.real;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringJoiner;

public class Code01_day0905 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] height = new int[n];
        for (int i = 0; i < n; i++) {
            height[i] = sc.nextInt();
        }
        int[] weight = new int[n];
        for (int i = 0; i < n; i++) {
            weight[i] = sc.nextInt();
        }

        System.out.println(getResult(n,height,weight));
    }
    public static String getResult(int n,int[] height,int[] weight){
        int[][] students = new int[n][3];
        for (int i = 0; i < n; i++) {
            students[i] = new int[]{height[i],weight[i],i+1};
        }
        Arrays.sort(
                students,(a,b) -> a[0] != b[0] ? a[0] - b[0]:a[1] !=b[1] ?a[1]-b[1]:a[2]-b[2]);
        StringJoiner sj = new StringJoiner(" ");
        for(int[] student : students){
            sj.add(student[2] + "");
        }
        return sj.toString();
    }


}
